home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XGrabPointer.z / XGrabPointer
Encoding:
Text File  |  2002-10-03  |  12.6 KB  |  265 lines

  1.  
  2.  
  3.  
  4.      XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XGrabPointer, XUngrabPointer, XChangeActivePointerGrab -
  10.           grab the pointer
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           int XGrabPointer(_d_i_s_p_l_a_y, _g_r_a_b__w_i_n_d_o_w, _o_w_n_e_r__e_v_e_n_t_s,
  14.           _e_v_e_n_t__m_a_s_k, _p_o_i_n_t_e_r__m_o_d_e,
  15.                          _k_e_y_b_o_a_r_d__m_o_d_e, _c_o_n_f_i_n_e__t_o, _c_u_r_s_o_r, _t_i_m_e)
  16.                 Display *_d_i_s_p_l_a_y;
  17.                 Window _g_r_a_b__w_i_n_d_o_w;
  18.                 Bool _o_w_n_e_r__e_v_e_n_t_s;
  19.                 unsigned int _e_v_e_n_t__m_a_s_k;
  20.                 int _p_o_i_n_t_e_r__m_o_d_e, _k_e_y_b_o_a_r_d__m_o_d_e;
  21.                 Window _c_o_n_f_i_n_e__t_o;
  22.                 Cursor _c_u_r_s_o_r;
  23.                 Time _t_i_m_e;
  24.  
  25.           XUngrabPointer(_d_i_s_p_l_a_y, _t_i_m_e)
  26.                 Display *_d_i_s_p_l_a_y;
  27.                 Time _t_i_m_e;
  28.  
  29.           XChangeActivePointerGrab(_d_i_s_p_l_a_y, _e_v_e_n_t__m_a_s_k, _c_u_r_s_o_r, _t_i_m_e)
  30.                 Display *_d_i_s_p_l_a_y;
  31.                 unsigned int _e_v_e_n_t__m_a_s_k;
  32.                 Cursor _c_u_r_s_o_r;
  33.                 Time _t_i_m_e;
  34.  
  35.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  36.           _c_o_n_f_i_n_e__t_o
  37.                     Specifies the window to confine the pointer in or
  38.                     _N_o_n_e.
  39.  
  40.           _c_u_r_s_o_r    Specifies the cursor that is to be displayed
  41.                     during the grab or _N_o_n_e.
  42.  
  43.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  44.  
  45.           _e_v_e_n_t__m_a_s_k
  46.                     Specifies which pointer events are reported to the
  47.                     client.  The mask is the bitwise inclusive OR of
  48.                     the valid pointer event mask bits.
  49.  
  50.           _g_r_a_b__w_i_n_d_o_w
  51.                     Specifies the grab window.
  52.  
  53.           _k_e_y_b_o_a_r_d__m_o_d_e
  54.                     Specifies further processing of keyboard events.
  55.                     You can pass _G_r_a_b_M_o_d_e_S_y_n_c or _G_r_a_b_M_o_d_e_A_s_y_n_c.
  56.  
  57.           _o_w_n_e_r__e_v_e_n_t_s
  58.                     Specifies a Boolean value that indicates whether
  59.                     the pointer events are to be reported as usual or
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.                     reported with respect to the grab window if
  75.                     selected by the event mask.
  76.  
  77.           _p_o_i_n_t_e_r__m_o_d_e
  78.                     Specifies further processing of pointer events.
  79.                     You can pass _G_r_a_b_M_o_d_e_S_y_n_c or _G_r_a_b_M_o_d_e_A_s_y_n_c.
  80.  
  81.           _t_i_m_e      Specifies the time.  You can pass either a
  82.                     timestamp or _C_u_r_r_e_n_t_T_i_m_e.
  83.  
  84.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  85.           The _X_G_r_a_b_P_o_i_n_t_e_r function actively grabs control of the
  86.           pointer and returns _G_r_a_b_S_u_c_c_e_s_s if the grab was successful.
  87.           Further pointer events are reported only to the grabbing
  88.           client.  _X_G_r_a_b_P_o_i_n_t_e_r overrides any active pointer grab by
  89.           this client.  If owner_events is _F_a_l_s_e, all generated
  90.           pointer events are reported with respect to grab_window and
  91.           are reported only if selected by event_mask.  If
  92.           owner_events is _T_r_u_e and if a generated pointer event would
  93.           normally be reported to this client, it is reported as
  94.           usual. Otherwise, the event is reported with respect to the
  95.           grab_window and is reported only if selected by event_mask.
  96.           For either value of owner_events, unreported events are
  97.           discarded.
  98.  
  99.           If the pointer_mode is _G_r_a_b_M_o_d_e_A_s_y_n_c, pointer event
  100.           processing continues as usual.  If the pointer is currently
  101.           frozen by this client, the processing of events for the
  102.           pointer is resumed.  If the pointer_mode is _G_r_a_b_M_o_d_e_S_y_n_c,
  103.           the state of the pointer, as seen by client applications,
  104.           appears to freeze, and the X server generates no further
  105.           pointer events until the grabbing client calls _X_A_l_l_o_w_E_v_e_n_t_s
  106.           or until the pointer grab is released.  Actual pointer
  107.           changes are not lost while the pointer is frozen; they are
  108.           simply queued in the server for later processing.
  109.  
  110.           If the keyboard_mode is _G_r_a_b_M_o_d_e_A_s_y_n_c, keyboard event
  111.           processing is unaffected by activation of the grab.  If the
  112.           keyboard_mode is _G_r_a_b_M_o_d_e_S_y_n_c, the state of the keyboard, as
  113.           seen by client applications, appears to freeze, and the X
  114.           server generates no further keyboard events until the
  115.           grabbing client calls _X_A_l_l_o_w_E_v_e_n_t_s or until the pointer grab
  116.           is released.  Actual keyboard changes are not lost while the
  117.           pointer is frozen; they are simply queued in the server for
  118.           later processing.
  119.  
  120.           If a cursor is specified, it is displayed regardless of what
  121.           window the pointer is in. If _N_o_n_e is specified, the normal
  122.           cursor for that window is displayed when the pointer is in
  123.           grab_window or one of its subwindows; otherwise, the cursor
  124.           for grab_window is displayed.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           If a confine_to window is specified, the pointer is
  141.           restricted to stay contained in that window.  The confine_to
  142.           window need have no relationship to the grab_window.  If the
  143.           pointer is not initially in the confine_to window, it is
  144.           warped automatically to the closest edge just before the
  145.           grab activates and enter/leave events are generated as
  146.           usual. If the confine_to window is subsequently
  147.           reconfigured, the pointer is warped automatically, as
  148.           necessary, to keep it contained in the window.
  149.  
  150.           The time argument allows you to avoid certain circumstances
  151.           that come up if applications take a long time to respond or
  152.           if there are long network delays.  Consider a situation
  153.           where you have two applications, both of which normally grab
  154.           the pointer when clicked on.  If both applications specify
  155.           the timestamp from the event, the second application may
  156.           wake up faster and successfully grab the pointer before the
  157.           first application. The first application then will get an
  158.           indication that the other application grabbed the pointer
  159.           before its request was processed.
  160.  
  161.           _X_G_r_a_b_P_o_i_n_t_e_r generates _E_n_t_e_r_N_o_t_i_f_y and _L_e_a_v_e_N_o_t_i_f_y events.
  162.  
  163.           Either if grab_window or confine_to window is not viewable
  164.           or if the confine_to window lies completely outside the
  165.           boundaries of the root window, _X_G_r_a_b_P_o_i_n_t_e_r fails and
  166.           returns _G_r_a_b_N_o_t_V_i_e_w_a_b_l_e.  If the pointer is actively grabbed
  167.           by some other client, it fails and returns _A_l_r_e_a_d_y_G_r_a_b_b_e_d.
  168.           If the pointer is frozen by an active grab of another
  169.           client, it fails and returns _G_r_a_b_F_r_o_z_e_n.  If the specified
  170.           time is earlier than the last-pointer-grab time or later
  171.           than the current X server time, it fails and returns
  172.           _G_r_a_b_I_n_v_a_l_i_d_T_i_m_e.  Otherwise, the last-pointer-grab time is
  173.           set to the specified time (_C_u_r_r_e_n_t_T_i_m_e is replaced by the
  174.           current X server time).
  175.  
  176.           _X_G_r_a_b_P_o_i_n_t_e_r can generate _B_a_d_C_u_r_s_o_r, _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w
  177.           errors.
  178.  
  179.           The _X_U_n_g_r_a_b_P_o_i_n_t_e_r function releases the pointer and any
  180.           queued events if this client has actively grabbed the
  181.           pointer from _X_G_r_a_b_P_o_i_n_t_e_r, _X_G_r_a_b_B_u_t_t_o_n, or from a normal
  182.           button press.  _X_U_n_g_r_a_b_P_o_i_n_t_e_r does not release the pointer
  183.           if the specified time is earlier than the last-pointer-grab
  184.           time or is later than the current X server time.  It also
  185.           generates _E_n_t_e_r_N_o_t_i_f_y and _L_e_a_v_e_N_o_t_i_f_y events.  The X server
  186.           performs an _U_n_g_r_a_b_P_o_i_n_t_e_r request automatically if the event
  187.           window or confine_to window for an active pointer grab
  188.           becomes not viewable or if window reconfiguration causes the
  189.           confine_to window to lie completely outside the boundaries
  190.           of the root window.
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXGGGGrrrraaaabbbbPPPPooooiiiinnnntttteeeerrrr((((3333XXXX11111111))))
  203.  
  204.  
  205.  
  206.           The _X_C_h_a_n_g_e_A_c_t_i_v_e_P_o_i_n_t_e_r_G_r_a_b function changes the specified
  207.           dynamic parameters if the pointer is actively grabbed by the
  208.           client and if the specified time is no earlier than the
  209.           last-pointer-grab time and no later than the current X
  210.           server time.  This function has no effect on the passive
  211.           parameters of a _X_G_r_a_b_B_u_t_t_o_n.  The interpretation of
  212.           event_mask and cursor is the same as described in
  213.           _X_G_r_a_b_P_o_i_n_t_e_r.
  214.  
  215.           _X_C_h_a_n_g_e_A_c_t_i_v_e_P_o_i_n_t_e_r_G_r_a_b can generate a _B_a_d_C_u_r_s_o_r and
  216.           _B_a_d_V_a_l_u_e error.
  217.  
  218.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  219.           _B_a_d_C_u_r_s_o_r A value for a Cursor argument does not name a
  220.                     defined Cursor.
  221.  
  222.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  223.                     values accepted by the request.  Unless a specific
  224.                     range is specified for an argument, the full range
  225.                     defined by the argument's type is accepted.  Any
  226.                     argument defined as a set of alternatives can
  227.                     generate this error.
  228.  
  229.           _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  230.                     defined Window.
  231.  
  232.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  233.           XAllowEvents(3X11), XGrabButton(3X11), XGrabKey(3X11),
  234.           XGrabKeyboard(3X11)
  235.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 10/3/02)
  262.  
  263.  
  264.  
  265.